﻿function ClientAddLawDocumentOffice()
{
    Url=Portal.CMS.LawDocumentOffice.GetAddGroupNewUrl().value;
    window.open(Url, '_blank');
    //RealJumpPageLawDocumentOffice();
}

function ClientSaveAddLawDocumentOffice()
{
    Subject=document.getElementById("txtSubject").value;
    RetValue = Portal.CMS.AddLawDocumentOffice.ServerSideAddLawDocumentOffice(Subject).value;
    if(RetValue.indexOf("ERROR")!=-1)
    {
        alert(RetValue);
        return;
    }
    alert(RetValue);
    document.getElementById("txtSubject").value="";
    document.getElementById("txtSubject").focus();
}

function ClientDeleteLawDocumentOffice(LawDocumentOfficeId)
{
    Msg=Portal.CMS.LawDocumentOffice.ServerSideCheckDeleteLawDocumentOffice().value;
    if(Msg.indexOf("ERROR")!=-1)
    {
        alert(Msg);
        return;
    }
    
    Msg=Portal.CMS.LawDocumentOffice.GetConfirmDeleteMsg().value;
    if(confirm(Msg)==false)return;
    RetValue = Portal.CMS.LawDocumentOffice.ServerSideDeleteLawDocumentOffice(LawDocumentOfficeId).value;
    if(RetValue.indexOf("ERROR")!=-1)
    {
        alert(RetValue);
        return;
    }
    alert(RetValue);
    RealJumpPageLawDocumentOffice();
}

function ShowClientUpdateUrlForm(LawDocumentOfficeId)
{
    Url=Portal.CMS.LawDocumentOffice.GetShowUpdateForm(LawDocumentOfficeId).value;
    if(Url.indexOf("ERROR")!=-1)
    {
        alert(Url);
        return;
    }
    window.open(Url, '_blank');
    //RealJumpPageLawDocumentOffice();
}



function ClientSaveUpdateLawDocumentOffice(LawDocumentOfficeId)
{
    Subject=document.getElementById("txtSubject").value;
    RetValue = Portal.CMS.UpdateLawDocumentOffice.ServerSideUpdateLawDocumentOffice(LawDocumentOfficeId,Subject).value;
    if(RetValue.indexOf("ERROR")!=-1)
    {
        alert(RetValue);
        return;
    }
    alert(RetValue);
    window.close();
}


function ShowClientLawDocumentOfficeItemUrlForm(LawDocumentOfficeId)
{
    Url=Portal.CMS.LawDocumentOffice.GetShowLawDocumentOfficeItemsForm(LawDocumentOfficeId).value;
    if(Url.indexOf("ERROR")!=-1)
    {
        alert(Url);
        return;
    }
    window.open(Url, '_blank');
}

function ClientShowNewsItemForms(LawDocumentOfficeId)
{
    Url=Portal.CMS.LawDocumentOffice.GetShowNewsItemForm(LawDocumentOfficeId).value;
    if(Url.indexOf("ERROR")!=-1)
    {
        alert(Url);
        return;
    }
    window.open(Url, '_blank');
}



function JumPageLawDocumentOffice()
{
    document.getElementById("divProcessing").innerHTML=Portal.CMS.LawDocumentOffice.GetProcessingText().value;
    setTimeout("RealJumpPageLawDocumentOffice()",10);
}

function RealJumpPageLawDocumentOffice()
{
    PageIndex=0;
    if(document.getElementById("divSelectPageLawDocumentOffice")!=null)
    {   
        PageIndex=document.getElementById("divSelectPageLawDocumentOffice").selectedIndex;
    }
    Keyword=document.getElementById("txtKeyword").value;
    retValue=Portal.CMS.LawDocumentOffice.GetHtml(Keyword,PageIndex).value;
    if(retValue.indexOf("ERROR")!=-1)
    {
        alert(retValue);
        return;
    }
    document.getElementById("divProcessing").innerHTML="";
    document.getElementById("divLawDocumentOfficeMain").innerHTML=retValue;
}